package com.woniu.aimd.mapper;

import com.woniu.aimd.pojo.entity.Wronganswerquestion;
import com.woniu.aimd.pojo.entity.Wrongchoicequestion;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SearchQuestionsMapper {
    @Select("select distinct (prompt)from choicequestions WHERE user_id = #{user_id} AND status = #{status}")
    List<String> findpromptC(@Param("user_id")String user_id, @Param("status")Integer status);
    @Select("select distinct (prompt)from answerquestions WHERE user_id = #{user_id} AND status = #{status}")
    List<String> findpromptA(@Param("user_id")String user_id, @Param("status")Integer status);
    @Select("SELECT * FROM answerquestions WHERE prompt LIKE CONCAT('%', #{prompt}, '%')")
    List<Wronganswerquestion> findanswerquestionprompt(@Param("prompt") String prompt);
    @Select("SELECT * FROM choicequestions WHERE prompt LIKE CONCAT('%', #{prompt}, '%')")
    List<Wrongchoicequestion> findchoicequestionprompt(@Param("prompt") String prompt);
}
